package com.xinnet.mms.order.dao;

import java.sql.SQLException;
import java.util.List;

import org.springframework.stereotype.Repository;

import com.xinnet.core.utils.page.PageView;
import com.xinnet.mms.entity.AgentConsume;
import com.xinnet.mms.entity.Customer;
import com.xinnet.mms.entity.CustomerCare;
import com.xinnet.mms.entity.CustomerConsume;
import com.xinnet.mms.entity.CustomerConsumptionDetail;

@Repository
public interface OrderDao {
	/**
	 * 
	 * 功能描述：根据会员id查询该会员的所有订单
	 * 
	 * @author 王湛智
	 * 
	 * @param cusId
	 * @return
	 * @throws SQLException
	 */
	public List<CustomerCare> getOrdersByCusId(String cusId) throws SQLException;
	/**
	 * 
	 * 功能描述：根据会员id以及当前时间查询该会员某个时间区间的所有订单
	 * 
	 * @author 王湛智
	 * 
	 * @param cusId
	 * @param timeSet
	 * @return
	 * @throws SQLException
	 */
	public List<CustomerCare> getOrdersByCusIdAndCurrentTime(String cusId,String timeSet) throws SQLException;
	/**
	 * 
	 * 功能描述：根据会员id以及产品ID查询该会员的订单
	 * 
	 * @author 王湛智
	 * 
	 * @param cusId
	 * @param productId
	 * @return
	 * @throws SQLException
	 */
	public List<CustomerCare> getOrdersByCusIdAndProductCode(String cusId,String productCode) throws Exception;
	
	/**
	 * 获取新订单
	 * @param startTime
	 * @param endTime
	 * @return
	 * @throws SQLException
	 */
	public List<CustomerCare> getNewOrder(String startTime,String endTime)throws SQLException;
	
	/**
	 * 获取即将到期商品
	 * @param pageView
	 * @param customerCare
	 * @return
	 */
	public List<Customer> queryDueSoonGoods(PageView<Customer> pageView,Customer customer);

	/**
	 * 通过客户ID获取相关订单
	 * @param customId
	 * @return
	 */
	public List<Customer> getOrderByCustomId(String customId);
	
	/**
	 * 获取新订单列表
	 * @param startTime
	 * @param endTime
	 * @return
	 * @throws SQLException
	 */
	public List<CustomerCare> getNewOrderList(String startTime,String endTime);
	
	/**
	 * 根据服务ID和产品Code获取服务时间
	 * @param customer
	 * @return
	 */
	public Customer getServiceTimeByServiceIdAndProductCode(Customer customer);
	
	public List<CustomerCare>  getDeldOrderList(String cusId,String productCode);

	public List<CustomerCare>  getAllOrderList();
	
	public Integer getDueSoonGoodsCount(Customer customer);
	
	public List<Customer> getCusIdByExpireDate(Customer customer);
	public List<Customer> getNYZJCusIdByExpireDate(Customer customer);
	public List<Customer> getZJZYCusIdByExpireDate(Customer customer);
	public List<Customer> getMCusIdByExpireDate(Customer customer);
	public List<Customer> getVCusIdByExpireDate(Customer customer);
	public List<Customer> getDCusIdByExpireDate(Customer customer);
	public List<Customer> getV_MEJZCusIdByExpireDate(Customer customer);
	public List<Customer> getCHIYUNCusIdByExpireDate(Customer customer);
	
	public List<CustomerCare>  getJianZhanOrder();
	
	public List<CustomerCare>  getDomainOrder();
	
	public List<CustomerCare>  getVirtualHostOrder();
	
	public List<CustomerCare>  getMailOrder();
	
	public List<CustomerCare>  getZJZYOrder();
	
	public List<CustomerCare>  getNYZJOrXNYYOrder();
	
	public List<CustomerCare>  getJianZhanOrderAll();
	
	public List<CustomerCare>  getDomainOrderAll();
	
	public List<CustomerCare>  getVirtualHostOrderAll();
	
	public List<CustomerCare>  getMailOrderAll();
	
	public List<CustomerCare>  getZJZYOrderAll();
	
	public List<CustomerCare>  getNYZJOrXNYYOrderAll();
	
	public List<CustomerCare>  getDeledDomainOrder();
	
	public List<CustomerCare>  getDeledVirtualHostOrder();
	
	public List<CustomerCare>  getDeledMailOrder();
	
	/**
	 * 查询即将到期的主机租用/托管
	 * @param pageView
	 * @param customer
	 * @return
	 */
	public List<Customer> queryIdc(PageView<Customer> pageView, Customer customer);
	
	/**
	 * 查询即将到期的云主机和VPS
	 * @param pageView
	 * @param customer
	 * @return
	 */
	public List<Customer> queryIdcServerHosting(PageView<Customer> pageView, Customer customer);
	
	/**
	 * 查询即将到期的邮局
	 * @param pageView
	 * @param customer
	 * @return
	 */
	public List<Customer> queryMailbox(PageView<Customer> pageView, Customer customer);
	
	/**
	 * 查询即将到期的虚机（不含驰云 、新虚机）
	 * @param pageView
	 * @param customer
	 * @return
	 */
	public List<Customer> queryVhost(PageView<Customer> pageView, Customer customer);
	
	/**
	 * 查询即将到期的驰云 
	 * @param pageView
	 * @param customer
	 * @return
	 */
	public List<Customer> queryChiYun(PageView<Customer> pageView, Customer customer);
		

	
	/**
	 * 查询即将到期的域名
	 * @param pageView
	 * @param customer
	 * @return
	 */
	public List<Customer> queryDomain(PageView<Customer> pageView, Customer customer);
	
	/**
	 * 查询即将到期的ME建站
	 * @param pageView
	 * @param customer
	 * @return
	 */
	public List<Customer> queryJianzhan(PageView<Customer> pageView, Customer customer);
	
	
	
	/**
	 * 查询即将到期的主机租用/托管
	 * @param pageView
	 * @param customer
	 * @return
	 */
	public List<Customer> queryIdcService(Customer customer);
	
	/**
	 * 查询即将到期的云主机和VPS
	 * @param pageView
	 * @param customer
	 * @return
	 */
	public List<Customer> queryIdcServerService(Customer customer);
	
	/**
	 * 查询即将到期的邮局
	 * @param pageView
	 * @param customer
	 * @return
	 */
	public List<Customer> queryMailboxService(Customer customer);
	
	/**
	 * 查询即将到期的office365
	 * @param pageView
	 * @param customer
	 * @return
	 */
	public List<Customer> queryOffice365Service(Customer customer);
	
	/**
	 * 查询即将到期的新办公应用
	 * @param pageView
	 * @param customer
	 * @return
	 */
	public List<Customer> queryNewOfficeService(Customer customer);
	
	/**
	 * 查询即将到期的虚机（不含驰云 、新虚机）
	 * @param pageView
	 * @param customer
	 * @return
	 */
	public List<Customer> queryVhostService(Customer customer);
	
	/**
	 * 查询即将到期的驰云 
	 * @param pageView
	 * @param customer
	 * @return
	 */
	public List<Customer> queryChiYunService(Customer customer);
		

	
	/**
	 * 查询即将到期的域名
	 * @param pageView
	 * @param customer
	 * @return
	 */
	public List<Customer> queryDomainService(Customer customer);
	
	/**
	 * 查询即将到期的ME建站
	 * @param pageView
	 * @param customer
	 * @return
	 */
	public List<Customer> queryJianzhanService(Customer customer);
	
	
	/**
	 * 通过客户ID获取购买商品
	 * @param pageView
	 * @param customer
	 * @return
	 */
	public List<Customer> queryBuyGoods(PageView<Customer> pageView, Customer customer);
	
	/**
	 * 通过客户ID获取购买商品
	 * @param pageView
	 * @param customer
	 * @return
	 */
	public List<Customer> queryOrderByCustomId(PageView<Customer> pageView,
			Customer customer);
	
	/**
	 * 通过客户ID获取购买商品
	 * @param pageView
	 * @param customer
	 * @return
	 */
	public Integer queryBuyGoodsCount(Customer customer);
	
	/**
	 * 通过客户ID获取购买商品
	 * @param pageView
	 * @param customer
	 * @return
	 */
	public Integer queryOrderByCustomIdCount(
			Customer customer);
	
	/**
	 * 获取即将到期的主机租用总记录数
	 * @param customer
	 * @return
	 */
	public Integer getIdcCount(Customer customer);
	
	/**
	 * 获取即将到期的云主机/VPS总记录数
	 * @param customer
	 * @return
	 */
	public Integer getIdcServerHostingCount(Customer customer);
	
	/**
	 * 获取即将到期的邮局总记录数
	 * @param customer
	 * @return
	 */
	public Integer getMailboxCount(Customer customer);
	
	/**
	 * 获取即将到期的虚机总记录数（不含驰云 、新虚机）
	 * @param customer
	 * @return
	 */
	public Integer getVhostCount(Customer customer);
	

	/**
	 * 查询即将到期的驰云 
	 * @param pageView
	 * @param customer
	 * @return
	 */
	public Integer getChiYunCount( Customer customer);
		

	
	/**
	 * 获取即将到期的域名总记录数
	 * @param customer
	 * @return
	 */
	public Integer getDomainCount(Customer customer);
	
	/**
	 * 获取即将到期的建站总记录数
	 * @param customer
	 * @return
	 */
	public Integer getJianzhanCount(Customer customer);
	
	/**
	 * 获取客户消费明细
	 * @param customerConsume
	 * @return
	 */
	public List<CustomerConsumptionDetail> getCustomerConsumptionDetail(PageView<CustomerConsumptionDetail> pageView,CustomerConsume customerConsume);
	
	/**
	 * 获取客户消费明细条数
	 * @param customerConsume
	 * @return
	 */
	public int getCCDetailCount(CustomerConsume customerConsume);
	
	/**
	 * 获取业绩明细（订单）
	 * @param customerConsume
	 * @return
	 */
	public List<AgentConsume> getAgentConsume(CustomerConsume customerConsume);
}

